package com.qkl.qkl.service;

import com.qkl.qkl.common.Dto;
import com.qkl.qkl.util.Conts;
import com.qkl.qkl.util.RequestDataUtil;
import com.qkl.qkl.util.SimpleHttpClient;
import org.springframework.stereotype.Service;

/**数字资产服务
 * Created by with Intellij IDEA
 * Author : tianhaoyi
 * Date : 2018/7/23
 * Time : 16:26
 */
@Service
public class DamAssetService {
    /**
     * 资产发行申请
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetApply(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetApplyRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_APPLY_URL, request);
        return result;
    }
    /**
     * 资产发行提交
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资产转让至中间账户申请（转让签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetTransferMidApplay(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidApplayRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_TRANSFER_MID_APPLY_URL, request);
        return result;
    }
    /**
     * 资产转让至中间账户提交（转让签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetTransferMidSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_TRANSFER_MID_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资产转让签收申请（转让签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetSigninApplay(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetSigninApplayRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_SIGNIN_APPLY_URL, request);
        return result;
    }
    /**
     * 资产转让签收提交（转让签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetSigninSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_SIGNIN_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资产转让申请（非签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetTransferApplay(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferApplayRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_TRANSFER_APPLY_URL, request);
        return result;
    }
    /**
     * 资产转让提交（非签收场景）
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetTransferSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_TRANSFER_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资产兑付申请
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetSettleApply(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetSettleApplyRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_SETTLE_APPLY_URL, request);
        return result;
    }
    /**
     * 资产兑付提交
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetSettleSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_SETTLE_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资产批量查询
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetAccountQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetAccountQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_ACCOUNT_QUERY_URL, request);
        return result;
    }
    /**
     * 交易批量查询
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetTransQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_TRANS_QUERY_URL, request);
        return result;
    }
    /**
     * 资产汇总对账
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetRecSumQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetRecSumQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_REC_SUM_QUERY_URL, request);
        return result;
    }
    /**
     * 资产明细对账
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetRecDetailQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetRecDetailQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_REC_DETAIL_QUERY_URL, request);
        return result;
    }
    /**
     * 交易汇总对账
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetRecTransSumQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetRecTransSumQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_REC_TRANS_SUM_QUERY_URL, request);
        return result;
    }
    /**
     * 交易明细对账
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetRecTransDetailQuery(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetRecTransDetailQueryRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_REC_TRANS_DETAIL_QUERY_URL, request);
        return result;
    }
    /**
     * 资产批量转让至中间账户申请(转让签收场景)
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetMulttransmidApply(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetMulttransmidApplyRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_MULTTRANSMID_APPLY_URL, request);
        return result;
    }
    /**
     * 资产批量转让至中间账户提交(转让签收场景)
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetMulttransmidSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_MULTTRANSMID_SUBMIT_URL, request);
        return result;
    }
    /**
     * 资资产批量转让签收申请(转让签收场景)
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetMulsigninApply(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetMulsigninApplyRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_MULSIGNIN_APPLY_URL, request);
        return result;
    }
    /**
     * 资资产批量转让签收提交(转让签收场景)
     * @param dto
     * @return
     * @throws Exception
     */
    public  String damAssetMulsigninSubmit(Dto dto) throws Exception {
        String request = RequestDataUtil.damAssetTransferMidSubmitRequest(dto);
        SimpleHttpClient httpClient = new SimpleHttpClient();
        String result = httpClient.post(Conts.DAM_ASSET_MULSIGNIN_SUBMIT_URL, request);
        return result;
    }
}
